package com.smartcruise.task;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.flyco.dialog.widget.NormalDialog;
import com.smartcruise.R;
import com.smartcruise.data.cruiseData.NodeTaskListBean;

/**
 * Created by FengChaoQun
 * on 2018/4/11 0011
 */

public class NodeInfoDialog extends NormalDialog {

    TextView name;
    TextView coordinate;
    private NodeTaskListBean nodeTaskListBean;

    public NodeInfoDialog(Context context, NodeTaskListBean nodeTaskListBean) {
        super(context);
        this.nodeTaskListBean = nodeTaskListBean;

        View rootView = View.inflate(getContext(), R.layout.dialog_node_info, null);
        name = rootView.findViewById(R.id.name);
        coordinate = rootView.findViewById(R.id.coordinate);
        name.setText(nodeTaskListBean.getPatrollingNodeEntity().getName());
        String lat = nodeTaskListBean.getPatrollingNodeEntity().getCoordinateList().get(0).getLat().substring(0, 8);
        String lng = nodeTaskListBean.getPatrollingNodeEntity().getCoordinateList().get(0).getLng().substring(0, 8);
        coordinate.setText(lat + ":" + lng);

        addContentView(rootView, null);
    }

}
